import React from 'react';
import { Table } from 'antd';
import type { ColumnsType } from 'antd/es/table';

interface DataType {
  key: string;
  credits: number;
  gradePoint: number;
  crank: number;
  prank: number;
}

const columns: ColumnsType<DataType> = [
  {
    title: '累计所获学分',
    dataIndex: 'credits',
    key: 'credits',
  },
  {
    title: '累计学分绩点',
    dataIndex: 'gradePoint',
    key: 'gradePoint',
  },
  {
    title: '班级排名',
    dataIndex: 'crank',
    key: 'crank',
  },
  {
    title: '专业排名',
    key: 'prank',
    dataIndex: 'prank',
  },
];

const data: DataType[] = [
  {
    key: '1',
    credits: 36,
    gradePoint: 12,
    crank: 1,
    prank: 1,
  },
];

const CourseGrades: React.FC<any> = () => {
  return (
    <div>
      <Table
        columns={columns}
        dataSource={data}
        pagination={{ hideOnSinglePage: true }}
      />
    </div>
  );
};

export default CourseGrades;
